# Contributor: Leonardo Arena <rnalrd@alpinelinux.org>
# Maintainer:  Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=perl-net-dns
_pkgname=Net-DNS
pkgver=1.25
pkgrel=0
pkgdesc="Perl interface to the DNS resolver"
url="https://www.net-dns.org/"
arch="noarch"
license="GPL-1.0-or-later or Artistic-1.0-Perl"
depends="perl"
makedepends="perl-dev"
subpackages="$pkgname-doc"
checkdepends="perl-digest-hmac perl-net-libidn perl-test-pod"
source="https://www.net-dns.org/download/Net-DNS-$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"

prepare() {
	default_prepare

	export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor
}

build() {
	export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	make
}

package() {
	make DESTDIR="$pkgdir" install
	# creates file collision among perl modules
	find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete
}

check() {
	make test
}

sha512sums="af26663346883ab6b6c4e0164120c41531d2439395bf5553cb3c8cf671a652d1ade42b692f054a079b2f073bf186c619e9a61c8dc69d07ff463ce1e5e2ce3bc2  Net-DNS-1.25.tar.gz"
